package com.hqyj.javaSpringCloudWeb.config;

import com.hqyj.javaSpringCloudWeb.interceptor.ViewMappingInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author ：Cwd
 * @date ：2021/8/18 15:18
 * @description：
 */
@Configuration
public class WebMVCConfig implements WebMvcConfigurer {

    @Autowired
    private ViewMappingInterceptor viewMappingInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(viewMappingInterceptor).addPathPatterns("/**");
    }

}
